package com.lanlian.commonlib.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.lanlian.commonlib.bean.db.DBMarketS;
import com.lanlian.commonlib.bean.db.DBMarketSerch;
import com.lanlian.commonlib.bean.db.DBMessage;
import com.lanlian.commonlib.bean.db.DBSearchQuestionHistory;
import com.lanlian.commonlib.bean.db.DBUser;
import com.lanlian.commonlib.bean.db.DBStyle;

import com.lanlian.commonlib.greendao.DBMarketSDao;
import com.lanlian.commonlib.greendao.DBMarketSerchDao;
import com.lanlian.commonlib.greendao.DBMessageDao;
import com.lanlian.commonlib.greendao.DBSearchQuestionHistoryDao;
import com.lanlian.commonlib.greendao.DBUserDao;
import com.lanlian.commonlib.greendao.DBStyleDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig dBMarketSDaoConfig;
    private final DaoConfig dBMarketSerchDaoConfig;
    private final DaoConfig dBMessageDaoConfig;
    private final DaoConfig dBSearchQuestionHistoryDaoConfig;
    private final DaoConfig dBUserDaoConfig;
    private final DaoConfig dBStyleDaoConfig;

    private final DBMarketSDao dBMarketSDao;
    private final DBMarketSerchDao dBMarketSerchDao;
    private final DBMessageDao dBMessageDao;
    private final DBSearchQuestionHistoryDao dBSearchQuestionHistoryDao;
    private final DBUserDao dBUserDao;
    private final DBStyleDao dBStyleDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        dBMarketSDaoConfig = daoConfigMap.get(DBMarketSDao.class).clone();
        dBMarketSDaoConfig.initIdentityScope(type);

        dBMarketSerchDaoConfig = daoConfigMap.get(DBMarketSerchDao.class).clone();
        dBMarketSerchDaoConfig.initIdentityScope(type);

        dBMessageDaoConfig = daoConfigMap.get(DBMessageDao.class).clone();
        dBMessageDaoConfig.initIdentityScope(type);

        dBSearchQuestionHistoryDaoConfig = daoConfigMap.get(DBSearchQuestionHistoryDao.class).clone();
        dBSearchQuestionHistoryDaoConfig.initIdentityScope(type);

        dBUserDaoConfig = daoConfigMap.get(DBUserDao.class).clone();
        dBUserDaoConfig.initIdentityScope(type);

        dBStyleDaoConfig = daoConfigMap.get(DBStyleDao.class).clone();
        dBStyleDaoConfig.initIdentityScope(type);

        dBMarketSDao = new DBMarketSDao(dBMarketSDaoConfig, this);
        dBMarketSerchDao = new DBMarketSerchDao(dBMarketSerchDaoConfig, this);
        dBMessageDao = new DBMessageDao(dBMessageDaoConfig, this);
        dBSearchQuestionHistoryDao = new DBSearchQuestionHistoryDao(dBSearchQuestionHistoryDaoConfig, this);
        dBUserDao = new DBUserDao(dBUserDaoConfig, this);
        dBStyleDao = new DBStyleDao(dBStyleDaoConfig, this);

        registerDao(DBMarketS.class, dBMarketSDao);
        registerDao(DBMarketSerch.class, dBMarketSerchDao);
        registerDao(DBMessage.class, dBMessageDao);
        registerDao(DBSearchQuestionHistory.class, dBSearchQuestionHistoryDao);
        registerDao(DBUser.class, dBUserDao);
        registerDao(DBStyle.class, dBStyleDao);
    }
    
    public void clear() {
        dBMarketSDaoConfig.clearIdentityScope();
        dBMarketSerchDaoConfig.clearIdentityScope();
        dBMessageDaoConfig.clearIdentityScope();
        dBSearchQuestionHistoryDaoConfig.clearIdentityScope();
        dBUserDaoConfig.clearIdentityScope();
        dBStyleDaoConfig.clearIdentityScope();
    }

    public DBMarketSDao getDBMarketSDao() {
        return dBMarketSDao;
    }

    public DBMarketSerchDao getDBMarketSerchDao() {
        return dBMarketSerchDao;
    }

    public DBMessageDao getDBMessageDao() {
        return dBMessageDao;
    }

    public DBSearchQuestionHistoryDao getDBSearchQuestionHistoryDao() {
        return dBSearchQuestionHistoryDao;
    }

    public DBUserDao getDBUserDao() {
        return dBUserDao;
    }

    public DBStyleDao getDBStyleDao() {
        return dBStyleDao;
    }

}
